package com.lovo.project.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lovo.project.bean.ClientBean;
import com.lovo.project.mapper.ClientMapper;
import com.lovo.project.service.ClientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.integration.IntegrationProperties;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ClientServiceImpl extends ServiceImpl<ClientMapper, ClientBean> implements ClientService {
    @Autowired
    ClientMapper clientMapper;

    @Override
    public Page<ClientBean> queryClientList(Page<ClientBean> page, QueryWrapper<ClientBean> queryWrapper) {
        Page<ClientBean> page1=clientMapper.selectPage(page,queryWrapper);
        return page1;
    }

    @Override
    public ClientBean queryClient(Integer clientId) {
        ClientBean clientBean=clientMapper.selectById(clientId);
        return clientBean;
    }

    @Override
    public void updateClient(ClientBean clientBean) {
        clientMapper.updateById(clientBean);
    }

    @Override
    public void insertClient(ClientBean clientBean) {
         clientMapper.insert(clientBean);
    }

    @Override
    public List<ClientBean> queryClientNameList(QueryWrapper queryWrapper) {
        List<ClientBean> list=clientMapper.selectList(queryWrapper);
        return list;
    }
}
